package cn.sangkf.litemall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : sangkf
 * @package : cn.sangkf.litemall.product.config.RedisConfig
 * @date : 2021/1/10 下午9:58 星期日
 * @description : TODO Redis配置
 * @version: 1.0
 * <p>Copyright: Copyright (c) 2020</p>
 */
@Configuration
public class RedisConfig {

    /**
     * Redisson配置注入
     * @return
     */
    @Bean(destroyMethod = "shutdown")
    public RedissonClient redissonClient(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://localhost:6380");
        return Redisson.create(config);
    }

}
